<?php include('header.php'); ?>
<?php include($include); ?>
<?php include('menu.php'); ?>

<script type="text/javascript">
    globalurl = "<?= base_url(); ?>";
</script>
<article id="basket">
    <button class="continue">Thanh toán</button>
    <table id="carts" width="100" border="1">
        <tr>
            <th scope="col" class="description">Tên sản phẩm</th>
            <th scope="col" class="options">Thông tin</th>
            <th align="right" scope="col" class="price">Giá</th>
        </tr>

        <?php
        $i = -1;
        foreach ($this->cart->contents() as $sp) {
            $i+=1;
            ?>
            <tr><?php
                $mt = $mota[$i];
                if (strlen($mt) > 200)
                    $mt = mb_substr($mt, 0, 200, "utf8") . "...";;
                ?>
                <td align="left" valign="top" class="description"><a href="#"><img src="<?= base_url() . 'public/images_product/' . $duongdan[$i]; ?>" alt="Hoa yêu thương" class="left" /></a><p><a href="<?= base_url("index.php/product?id=") . $sp['id']; ?>">Hoa yêu thương</a><br /> <?= $mt; ?></p>
                <td align="left" valign="top" class="options" >
                    <dl >
                        <dt >Mã SP:</dt>
                        <dd  ><?= $sp['id']; ?></dd>
                        <dt>Loại:</dt>
                        <dd>Hoa chúc mừng</dd>
                        <dt>Số lượng:</dt>
                        <dd><?= $sp['qty']; ?></dd>
                    </dl>
                    <button class="removeitem" id="<?= $sp['rowid'] ;?>" >Xóa khỏi giỏ hàng</button>
                </td>
                <td align="right" valign="top" class="price"><?= $this->cart->format_number(($sp['qty'] * $sp['price'])) . " .VNĐ"; ?></td>
            </tr>
        <?php }
        ?>

    </table>                       
    <img src="<?= site_url("public/logo/creditcards.gif"); ?> " class="safe" />
    <div class="right">
        <strong>Tổng tiền:</strong> <em id="tongtien"><?= $this->cart->format_number($this->cart->total()) . "VNĐ"; ?></em><br />
        <p>
            <select id="cbbgiaohang">
                <option value="0" >Giao hàng 3-5 ngày (Miễn phí)</option>
                <option value="50000">Giao hàng trong ngày (50.000 VNĐ)</option>
            </select> <em id="tienvanchuyen">0 VNĐ</em>
        </p>
        <strong>Tổng tiền đơn hàng: </strong> <em id="tongcongchiphi"><?php echo $this->cart->format_number($this->cart->total()); ?> </em>
        <div id="tong1"><?php echo $this->cart->format_number($this->cart->total()+50000); ?> </div>
    </div>
    <button class="continue" id='billing'>Thanh toán</button>
</article>
<div class="clear"></div>

<?php include('footer.php'); ?>